<html>
<head><meta charset="utf-8"><title>Meeting 2019-08-29 · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html">Meeting 2019-08-29</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="174428336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174428336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174428336">(Aug 29 2019 at 06:45)</a>:</h4>
<p>I am not sure how much time I'll have today, so I figured I would start asynchronously... is there much to talk about?<br>
I propose we merge <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/186" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/186">https://github.com/rust-lang/unsafe-code-guidelines/pull/186</a> and <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/161" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/161">https://github.com/rust-lang/unsafe-code-guidelines/pull/161</a> -- both have green light from <span class="user-mention" data-user-id="132920">@gnzlbg</span>  and me, so if <span class="user-mention" data-user-id="124289">@rkruppe</span> or someone else also r+'s we are good to go.<br>
I think we should wait with <a href="https://github.com/rust-lang/unsafe-code-guidelines/pull/197" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/pull/197">https://github.com/rust-lang/unsafe-code-guidelines/pull/197</a>, based on the last comment I posted there.</p>



<a name="174430754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174430754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174430754">(Aug 29 2019 at 07:37)</a>:</h4>
<p>+1</p>



<a name="174430838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174430838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174430838">(Aug 29 2019 at 07:39)</a>:</h4>
<p>I'll rebase <a href="https://github.com/rust-lang/rust/issues/153" target="_blank" title="https://github.com/rust-lang/rust/issues/153">#153</a> and will start updating things there</p>



<a name="174463134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174463134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174463134">(Aug 29 2019 at 15:13)</a>:</h4>
<p>Hey all</p>



<a name="174463142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174463142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174463142">(Aug 29 2019 at 15:13)</a>:</h4>
<p>I've seen some mentions from here</p>



<a name="174463156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174463156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174463156">(Aug 29 2019 at 15:13)</a>:</h4>
<p>I'm sorry for being so unresponsive</p>



<a name="174463278"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174463278" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174463278">(Aug 29 2019 at 15:14)</a>:</h4>
<p>I've marked this stream as read at some point without really catching up -- was too far behind -- but I'm happy to be repinged on things I'm holding up. I've also been thinking that we're due for another conversation about how to "integrate" UCG and T-lang efforts more tightly. This seems obviously quite relevant in the async I/O effort</p>



<a name="174471634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174471634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174471634">(Aug 29 2019 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  check the UCG repository diff if you want to catch up. then you can skip all the long discussions we had and just see the conclusions. ;)</p>



<a name="174477952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174477952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174477952">(Aug 29 2019 at 18:09)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> while not much progress has happened for validity, we have made a bit of progress for layout, defining things like padding, added most basic layout guarantees, and identifying work that remains to be done (properly specifying layout for repr(C) unions, and defining layout for uninhabited types).</p>



<a name="174478014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478014">(Aug 29 2019 at 18:09)</a>:</h4>
<p>the validity of fn ptrs is pretty much there, and I'd guess when can already word validity for product types</p>



<a name="174478152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478152">(Aug 29 2019 at 18:10)</a>:</h4>
<p>the validity of references seems to have reached a stable point, but <span class="user-mention" data-user-id="120791">@RalfJ</span> might be able to expand on that</p>



<a name="174478242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478242">(Aug 29 2019 at 18:11)</a>:</h4>
<p>stable maybe, not sure if we're done with all the trade-offs</p>



<a name="174478295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478295">(Aug 29 2019 at 18:11)</a>:</h4>
<p>I feel validity of ints is more stable. or is there still anyone opposed to allowing uninit ints (and declaring any arithmetical, logical or other operation on them UB)?</p>



<a name="174478481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478481">(Aug 29 2019 at 18:13)</a>:</h4>
<p>i think i've made my peace with that</p>



<a name="174478563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478563">(Aug 29 2019 at 18:14)</a>:</h4>
<p>(I think i commented there that a PR for adding the validity of int as uninit is ok would be fine for me?)</p>



<a name="174478639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478639">(Aug 29 2019 at 18:15)</a>:</h4>
<p>maybe we could at least add a PR with a summary of the rationale ?</p>



<a name="174478658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478658">(Aug 29 2019 at 18:16)</a>:</h4>
<p>"writeup-needed" or so?</p>



<a name="174478678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478678">(Aug 29 2019 at 18:16)</a>:</h4>
<p>it's a binary option, so either way the rationale needs to contains pros/cons of both, and explain why we pick one</p>



<a name="174478742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478742">(Aug 29 2019 at 18:16)</a>:</h4>
<p>yeah</p>



<a name="174478952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174478952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174478952">(Aug 29 2019 at 18:18)</a>:</h4>
<p>well I'm gone for most of the next 5 weeks, I am not comitting to anything right now I am afraid</p>



<a name="174479639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174479639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174479639">(Aug 29 2019 at 18:26)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> i'm going to post that the first step is summarzing the pros / cons - that feels worth doing before actually writing the value representation of these types down.</p>



<a name="174479731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174479731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174479731">(Aug 29 2019 at 18:28)</a>:</h4>
<p>we also need to find some way to future proof for whatever LLVM ends up doing wrt. provenance</p>



<a name="174479920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174479920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174479920">(Aug 29 2019 at 18:30)</a>:</h4>
<p>you mean if integers carry pointer provenance ?</p>



<a name="174479987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174479987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174479987">(Aug 29 2019 at 18:31)</a>:</h4>
<p>does that affect the validity of integers themselves ?</p>



<a name="174480023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174480023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174480023">(Aug 29 2019 at 18:31)</a>:</h4>
<p>of course, if the integer is part of a pointer that's part of the integer value</p>



<a name="174480094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174480094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174480094">(Aug 29 2019 at 18:32)</a>:</h4>
<p>I think I'm fine with a summary first, and then writing the value representation of integers without provenance</p>



<a name="174480119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174480119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174480119">(Aug 29 2019 at 18:32)</a>:</h4>
<p>we can always launder these integers in LLVM</p>



<a name="174480126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174480126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174480126">(Aug 29 2019 at 18:32)</a>:</h4>
<p>(by doing something like <code>black_box</code>)</p>



<a name="174480324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174480324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174480324">(Aug 29 2019 at 18:35)</a>:</h4>
<blockquote>
<p>does that affect the validity of integers themselves ?</p>
</blockquote>
<p>see what I wrote in the fn ptr RFC PR</p>



<a name="174480478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174480478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174480478">(Aug 29 2019 at 18:37)</a>:</h4>
<p>basically it might end up happening that transmuting a pointer to an int gives poison in LLVM. so we could make that UB or "uninitialized integer", but either way it gets reflected in the representation relation.</p>



<a name="174503272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting%202019-08-29/near/174503272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Meeting.202019-08-29.html#174503272">(Aug 29 2019 at 23:54)</a>:</h4>
<p>hadnt seen that yet</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>